var element = document.querySelector("#content");
printChar(element, 20);

/**
 * @param {Object} ele
 * @param {Number} speed
 */
function printChar(ele, speed) {
  var content = ele.innerText,
    fullContent = ele.innerHTML,
    len = ele.innerText.length;
  ele.innerText = "";
  var newContent = "";
  var i = 0;
  var timer = setInterval(function() {
    newContent += content.substr(i++, 1);
    ele.innerText = newContent;
    if (i === len) {
      ele.innerHTML = fullContent;
      clearInterval(timer);
    }
  }, speed);
}
